import { getToken } from '@/utils/auth'

// 用户相关数据
const state = {
    token: getToken(),
    name: '',
    avatar: '',
    // 菜单
    menu: []
}

const mutations = {
    SET_TOKEN: (state, token) => {
        state.token = token;
    },
    SET_NAME: (state, name) => {
        state.name = name
    },
    SET_AVATAR: (state, avatar) => {
        state.avatar = avatar
    },
    SET_MENU: (state, menu) => {
        state.menu = menu;
    }
}
const actions = {}
export default {
    namespaced: true,
    state,
    mutations,
    actions
}